<html>
<head>
{php}html_header_show();{/php}
{literal}
<script language="javascript">
function calculateBMI()
{
  var bmi = 0;
  var height = document.vitals.height.value;
  var weight = document.vitals.weight.value;
  if(height > 0 && weight > 0)
  {
    bmi = weight/height/height*10000;
  }
  document.vitals.BMI.value = bmi;
  return bmi;
}
</script>
<style type="text/css" title="mystyles" media="all">
<!--
td {
  font-size: 12pt;
  font-family: helvetica;
}
li {
  font-size: 11pt;
  font-family: helvetica;
  margin-left: 15px;
}
a {
  font-size: 11pt;
  font-family: helvetica;
}
.title {
  font-family: sans-serif;
  font-size: 12pt;
  font-weight: bold;
  text-decoration: none;
  color: #000000;
}

.form_text{
  font-family: sans-serif;
  font-size: 9pt;
  text-decoration: none;
  color: #000000;
}
-->
</style>
{/literal}
</head>

<body bgcolor="{$STYLE.BGCOLOR2}">
<p><span class="title">{xl t="Vitals (Metric)"}</span></p>
<form name="vitals" method="post" action="{$FORM_ACTION}/interface/forms/vitalsM/save.php"
 onsubmit="return top.restoreSession()">
<table>
  <tr>
    <th align="left">{xl t="Name"}</th><th align="left">{xl t="Unit"}</th>
    <th align="right">{$vitals->get_date()|date_format:"%m/%d/%y"}</th>
  {foreach item=result from=$results}
    <th align='right'>{$result.date|date_format:"%m/%d/%y"}</th>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="Weight"}</td><td>{xl t="kg"}</td>
    <td align='right'><input type="text"  size='5'
    name="weight" value="{$vitals->get_weight()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.weight}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="Height"}</td><td>{xl t="cm"}</td>
    <td align='right'><input type="text" size='5'
      name="height" value="{$vitals->get_height()}" onchange="calculateBMI();"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.height}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="BP Systolic"}</td><td>{xl t="mmHg"}</td>
    <td align='right'><input type="text" size='5'
      name="bps" value="{$vitals->get_bps()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.bps}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="BP Diastolic"}</td><td>{xl t="mmHg"}</td>
    <td align='right'><input type="text" size='5'
      name="bpd" value="{$vitals->get_bpd()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.bpd}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="Pulse"}</td><td>{xl t="per min"}</td>
    <td align='right'><input type="text" size='5'
      name="pulse" value="{$vitals->get_pulse()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.pulse}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="Respiration"}</td><td>{xl t="per min"}</td>
    <td align='right'><input type="text" size='5'
      name="respiration" value="{$vitals->get_respiration()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.respiration}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="Temperature"}</td><td>{xl t="C"}</td>
    <td align='right'><input type="text" size='5'
      name="temperature" value="{$vitals->get_temperature()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.temperature}</td>
  {/foreach}
  </tr>

  <tr>
    <td>{xl t="Temp Location"}</td>
    <td colspan='2' >
      <select name="temp_method"/><option value=""> </option>
      <option value="Oral"              {if $vitals->get_temp_method() == "Oral"              || $vitals->get_temp_method() == 2 } selected{/if}>{xl t="Oral"}
      <option value="Tympanic Membrane" {if $vitals->get_temp_method() == "Tympanic Membrane" || $vitals->get_temp_method() == 1 } selected{/if}>{xl t="Tympanic Membrane"}
      <option value="Rectal"            {if $vitals->get_temp_method() == "Rectal"            || $vitals->get_temp_method() == 3 } selected{/if}>{xl t="Rectal"}
      <option value="Axillary"          {if $vitals->get_temp_method() == "Axillary"          || $vitals->get_temp_method() == 4 } selected{/if}>{xl t="Axillary"}
      <option value="Temporal Artery"   {if $vitals->get_temp_method() == "Temporal Artery" } selected{/if}>{xl t="Temporal Artery"}
      </select>
    </td>
  {foreach item=result from=$results}
    <td align='right'>{xl t=$result.temp_method}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="Oxygen Saturation"}</td><td>{xl t="%"}</td>
    <td align='right'><input type="text" size='5'
      name="oxygen_saturation" value="{$vitals->get_oxygen_saturation()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.oxygen_saturation}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="Head Circumference"}</td><td>{xl t="cm"}</td>
    <td align='right'><input type="text" size='5'
      name="head_circ" value="{$vitals->get_head_circ()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.head_circ}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="Waist Circumference"}</td><td>{xl t="cm"}</td>
    <td align='right'><input type="text" size='5'
      name="waist_circ" value="{$vitals->get_waist_circ()}"/></td>
  {foreach item=result from=$results}
    <td align='right'>{$result.waist_circ}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="BMI"}</td><td>{xl t="%"}</td>
    <td align='right'><input type="text" size='5'
      name="BMI" value="{$vitals->get_BMI()}"/></td>
  {foreach item=result from=$results}
    <td  align='right'>{$result.BMI}</td>
  {/foreach}</tr>

  <tr><td>{xl t="BMI Status"}</td><td>{xl t="Type"}</td>
    <td align='right'>{$vitals->get_BMI_status()}</td>
  {foreach item=result from=$results}
    <td  align='right'>{xl t=$result.BMI_status}</td>
  {/foreach}
  </tr>

  <tr><td>{xl t="Other Notes"}</td>
    <td colspan='2' align='right'><input type="text" size='20'
      name="note" value="{$vitals->get_note()}" /></td>
  {foreach item=result from=$results}
    <td align='right'>{$result.note}</td>
  {/foreach}</tr>

  <tr>
    <td><input type="submit" name="Submit" value="{xl t="Save Form"}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{$DONT_SAVE_LINK}" class="link">[{xl t="Don't Save"}]</a></td>
  </tr>
</table>
<input type="hidden" name="id" value="{$vitals->get_id()}" />
<input type="hidden" name="activity" value="{$vitals->get_activity()}">
<input type="hidden" name="pid" value="{$vitals->get_pid()}">
<input type="hidden" name="process" value="true">
</form>
</body>
</html>
